var keythereum = require("keythereum");
//var options = {
//  kdf: "scrypt",
//  cipher: "aes-128-ctr",
//  kdfparams: {
//    c: 262144,
//    dklen: 32,
//    r:8,
//    p:1
//  }
//};
//
//
//var params = { keyBytes: 32, ivBytes: 16 };
//
//// synchronous
//var dk = keythereum.create(params);
//
//
//// asynchronous
//keythereum.create(params, function (dk) {
//    // do stuff!
//    var keyObject = keythereum.dump("123456", dk.privateKey, dk.salt, dk.iv, options);
//	console.log(keyObject)
//});

// synchronous


// Specify a data directory (optional; defaults to ~/.ethereum)
var datadir = "./";
var address = "10a5fa2fff03438941f262a660b4cd073524c205";
// Synchronous
var keyObject = keythereum.importFromFile(address, datadir);
console.log(keyObject)
// Asynchronous
//keythereum.importFromFile(address, datadir, function (keyObject) {
  // do stuff
//});

// synchronous
var privateKey = keythereum.recover("123456", keyObject);
console.log(privateKey)